import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import ProductList from '../views/ProductList.vue'
import ProductDetail from '../views/ProductDetail.vue'
import Cart from '../views/Cart.vue'
import Checkout from '../views/Checkout.vue'
import ChatComponent from '../views/ChatComponent.vue'
import Login from '../views/Login.vue'
import Pay from '../views/404.vue'
import Intro from '../views/Introduce.vue'
// xzd
import SystemMessage from'../views/SystemMessage.vue'
import OrderStatus from '../views/OrderStatus.vue'
import OK from '../views/OK.vue'
import Apt from '../Views/Apt.vue'
// 测试用
// import Test from '../views/test.vue'

//gyqh
import Classify from'../views/Classify.vue'


const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/chatComponent',
    name: 'ChatComponent',
    component: ChatComponent
  },
    // xzd
    {
      path: '/system-message', // 修改为小写，以避免大小写冲突
      name: 'SystemMessage',
      component: SystemMessage,
    },
    {
      path: '/order-status/:orderindex', // 路由路径小写
      name: 'OrderStatus',
      component: OrderStatus,
      props: true, // 启用 props 传递路由参数
    },
    {
      path: '/ok',
      name: 'OK',
      component: OK
    },
  //

  //gyqh
  {
    path:'/classify', 
    name: 'Classify',
    component: Classify,
  },



  {
    path: '/productlist',
    name: 'ProductList',
    component: ProductList
  },
  {
    path: '/products/:id',
    name: 'ProductDetail',
    component: ProductDetail
  },
  {
    path: '/cart',
    name: 'Cart',
    component: Cart
  },
  {
    path: '/checkout',
    name: 'Checkout',
    component: Checkout
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/pay',
    name: 'Pay',
    component: Pay
  },{
    path: '/intro',
    name: 'Intro',
    component: Intro
  },
  {
    path:'/Apt', 
    name: 'Apt',
    component: Apt,
  },
  // {
  //   path: '/test',
  //   name: 'Test',
  //   component: Test
  // },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router